{
GdkWindow *parent;
- /* X throws BadMatch if the parent has a different visual when
+ /* X throws BadMatch if the parent has a different depth when
* using ParentRelative */
parent = gdk_window_get_parent (window);
- if (parent && gdk_window_get_visual (parent) == gdk_window_get_visual (window))
+ if (parent && window->depth != parent->depth)
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window), ParentRelative);
+ GDK_WINDOW_XID (window), None);
else
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
- GDK_WINDOW_XID (window), None);
+ GDK_WINDOW_XID (window), ParentRelative);
return;
}